package com.yubest.rabbitmq.mq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class WorkConsumer {

    @RabbitListener(queuesToDeclare = @Queue("test.work.queue"))
    public void consumer1(String msg) {
        log.info("类型【work】-1，队列【test.work.queue】，收到的消息【{}】", msg);
    }

    @RabbitListener(queuesToDeclare = @Queue("test.work.queue"))
    public void consumer2(String msg) {
        log.info("类型【work】-2，队列【test.work.queue】，收到的消息【{}】", msg);
    }
}
